package org.nicocube.airain.app.server;

import org.nicocube.airain.domain.client.exception.DomainException;
import org.nicocube.airain.domain.server.dao.DomainDAO;
import org.nicocube.airain.domain.server.storable.PlayerDAO;

import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;

public class JspUtils {
	public static boolean checkPlayer() throws DomainException {

		UserService userService = UserServiceFactory.getUserService();
		User user = userService.getCurrentUser();
		
		return DomainDAO.getDao(PlayerDAO.class).exists(user);
	}
}
